import axios from 'axios';
const base = {
    dp: '/api'
};
const AxiosRequest = {
    ApiGet(url, param={}){
        let token = localStorage.getItem('token');
        if (token !== null){
            token = token.toString();
        }else {
            token = '';
        }
        return axios.get(url,{
            params:param,
            headers:{token:token}
        });
    },
    ApiPost(url, param){
        let token = localStorage.getItem('token');
        if (token !== null){
            token = token.toString();
        }else {
            token = '';
        }
        return axios.post(url,param,{
            headers:{token:token}
        });
    },
    AxiosUpload(url, param){
        let token = localStorage.getItem('token');
        if (token !== null){
            token = token.toString();
        }else {
            token = '';
        }
        return axios.post(url,param,{
            headers:{token:token,'Content-Type': 'multipart/form-data'}
        });
    }
};
export default  {
    base: base,
    AxiosRequest : AxiosRequest
};
